#include "unp.h"

int main(int argc ,char *argv[])
{
   size_t n;
   char buf[MAXLINE],command[MAXLINE+1];
   FILE *fp;
  
   if(fgets(buf,MAXLINE,stdin) == NULL){
     err_sys("fgets");
   }
   n = strlen(buf);
   if(buf[n-1] == '\n')
     n--;
   snprintf(command,MAXLINE,"cat %s",buf);
   fp = popen(command,"r");
   if(fp == NULL) 
     err_sys("popen error");

   while(fgets(buf,MAXLINE,fp) != NULL){
     fputs(buf,stdout);
   }
   pclose(fp);
   return 0;
}
